package com.flash.TAManagement.mapper;


import com.flash.TAManagement.entity.Ta;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface TaMapper {

    //查询所有
    @Select("select * from(select t.*,rownum rn from(select * from Ta)t)a where 1=1 ${strWhere} and rn between #{strPage} and #{strLimit}")
    List<Ta> selectTa(Map map);
    @Select("select count(*) from Ta")
    int selectTaCount();
    //增加
    @Insert("insert into ta values(#{taId},#{cashId},#{fundId},#{dealType},#{quantity},#{cost},#{dealTime},#{unitPrice}," +
            "#{endTime},#{commissionAgents},#{money},#{practicalMoney},#{dealState})")
    public int insertTa(Ta ta);

    //删除
    @Delete("delete from ta where taId = #{taId}")
    int deleteTa(String   taId);

    //修改
    @Update("update ta set cashId=#{cashId},fundId=#{fundId},dealType=#{dealType},quantity=#{quantity}," +
            "cost=#{cost},dealTime=#{dealTime},unitPrice=#{unitPrice},endTime=#{endTime},commissionAgents=#{commissionAgents}," +
            "money=#{money},practicalMoney=#{practicalMoney},dealState=#{dealState} where taId=#{taId}")
    public int updateTa(Ta ta);
}
